import { createResponse } from './util'
const Mock = require('mockjs')
Mock.setup({
    timeout: '200-3000'
})

const list = Mock.mock('/st/list', createResponse({
    'data|10': {
        'id|+1': 1
    }
}))

const sourceRadio = Mock.mock('/source/radio', createResponse({
    'data|3-15': [
        {
            'label|+1': 1,
            value: '@ctitle'
        }
    ]
}))
const sourceCheckbox = Mock.mock('/source/checkbox', createResponse({
    'data|3-15': [
        {
            'label|+1': 1,
            value: '@ctitle'
        }
    ]
}))
const sourceAutocomplete = Mock.mock('/source/autocomplete', createResponse({
    'data|3-15': [
        {
            'id|+1': 1,
            value: '@ctitle'
        }
    ]
}))
const sourceSelect = Mock.mock('/source/select', createResponse({
    'data|3-15': [
        {
            'value|+1': 1,
            label: '@ctitle'
        }
    ]
}))
const sourceCascader = Mock.mock('/source/cascader', createResponse({
    'data|3-15': [
        {
            'value|+1': 1,
            label: '@ctitle',
            'children|0-6': [
                {
                    'value|+1': 1000,
                    label: '@ctitle',
                    'children|0-6': [
                        {
                            'value|+1': 10000,
                            label: '@ctitle'
                        }
                    ]
                }
            ]
        }
    ]
}))
const sourceColorPicker = Mock.mock('/source/colorPicker', createResponse({
    'data|6-10': ['@color()', '@color()', '@color()', '@color()', '@color()', '@color()', '@color()']
}))
const sourceTransfer = Mock.mock('/source/transfer', createResponse({
    'data|3-15': [
        {
            'key|+1': 1,
            label: '@ctitle'
        }
    ]
}))
const sourceTree = Mock.mock('/source/tree', createResponse({
    'id|4-10': [
        {
            'id|+1': 1,
            label: '@ctitle',
            'children|0-10': [
                {
                    'id|+1': 1000,
                    label: '@ctitle',
                    'children|0-10': [
                        {
                            'id|+1': 10000,
                            label: '@ctitle'
                        }
                    ]
                }
            ]
        }
    ]
}))

export default {
    list,
    sourceRadio,
    sourceCheckbox,
    sourceAutocomplete,
    sourceSelect,
    sourceCascader,
    sourceCascaderPanel: sourceCascader,
    sourceColorPicker,
    sourceTransfer,
    sourceTree
}
